<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>计数器</title>
    <link rel="stylesheet" href="css/index.css" />
</head>

<body>
<!-- html结构 -->
<div id="app">
    <!-- 计数器功能区域 -->
    <div class="input-num">
        <button @click="jian">
            -
        </button>
        <span>{{num}}</span>
        <button @click="addNum">
            +
        </button>
    </div>
</div>
<!-- 开发环境版本，包含了有帮助的命令行警告 -->
<!-- 编码 -->
<script type="text/javascript" src="../js/vue.js"></script>
</body>
<script>
    let app = new Vue({
        el:"#app",
        data:{
            num:0,
        },
        methods:{

            addNum(){
                this.num++
            },

            jian(){
                this.num--
            }
        }
    })
</script>
</html>